//
//  FCRelationTableViewCell.m
//  customerRelation_Example
//
//  Created by 陈文斌 on 2019/2/15.
//  Copyright © 2019 64912907. All rights reserved.
//

#import "FCRelationTableViewCell.h"
#import "CustomerRelationHeader.h"

@implementation FCRelationTableViewCell
- (void)setContactNumberWithNumber:(NSInteger)number{
    if (number) {
        self.contactNumber.text = [NSString stringWithFormat:@"（%ld）", number];
    } else {
        self.contactNumber.text = @" ";
    }
}

- (void)setStatusStyleWithStatus:(NSString *)status{
    self.status.text = @" ";
    
    if ([status isEqualToString:@"Request"]) {
        self.status.text = customerRelationLocaChanged(@"已发送绑定请求", @"已发送绑定请求");
        self.status.textColor = FCBlueBackColor;
    }
    if ([status isEqualToString:@"Reject"]){
        self.status.text = customerRelationLocaChanged(@"请求被驳回", @"请求被驳回");
        self.status.textColor = FCRedBackColor;
    }
    if ([status isEqualToString:@"Agree"]){
        self.status.text = @" ";
    }
}

- (void)setAreaInfoWithResidentProvince:(NSString *)residentProvince ResidentArea:(NSString *)residentArea Status:(NSString *)status{
    self.contactNumber.text = @" ";
    
    if ([status isEqualToString:@"Agree"]){
        if (residentProvince.length > 0 && residentArea.length > 0) {
            self.contactNumber.text = [NSString stringWithFormat:@"  %@·%@", residentProvince, residentArea];
        } else{
            self.contactNumber.text = [NSString stringWithFormat:@"  %@%@", residentProvince, residentArea];
        }
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.contactNumber.text = @" ";
    self.status.text = @" ";
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
